package cn.com.lms.business.questionnaire.persistence.entity;
import com.bnzj.core.json.DateDeserializer;
import com.bnzj.core.util.FbConstant;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @Author: 16266
 * @DateTime: 2020/4/2 15:38
 * @Description: 用户问卷标题
 */
@Entity
@Getter
@Setter
@ToString
public class UserQuestionnaireTitle implements Serializable {

    @Schema(description = "计划Id")
    @Column(name = "plan_id")
    private Long planId;

    @Schema(description = "计划名称")
    @Column(name = "plan_name")
    private String planName;

    @Schema(description = "计划Id")
    @Column(name = "stage_id")
    private Long stageId;

    @Schema(description = "学习阶段名称")
    @Column(name = "stage_name")
    private String stageName;

    @Column(name = "create_time", updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = FbConstant.DATETIME_FORMAT)
    @JsonDeserialize(using = DateDeserializer.class)
    @JsonFormat(pattern = FbConstant.DATETIME_FORMAT, timezone = "GMT+8")
    @Schema(description = "创建时间")
    protected Date createTime;// 创建时间

    @Schema(description = "问卷ID")
    @Id
    @Column(name = "questionnaire_id")
    private Long questionnaireId;

    @Schema(description = "用户ID")
    @Column(name = "user_id")
    private Long userId;

    @Schema(description = "阶段详情Id")
    @Column(name = "stage_detail_id")
    private Long stageDetailId;

    @Schema(description = "问卷名称")
    @Column(name = "questionnaire_name")
    private String questionnaireName;

    @Schema(description = "状态")
    @Column(name = "status")
    private Byte status;
}
